<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c"  uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户信息修改</title>
<link href="<%=request.getContextPath()%>/css/css.css" rel="stylesheet" type="text/css">
</head>

<body class="write_bg">
<!-- 1.在form表单中，如果要执行文件上传（即包含有文件域），需要修改form表单的默认编码为：enctype="multipart/form-data"
 	 2.默认的格式是：application/x-www-form-urlencoded
 	 3.使用multipart/form-data编码数据后，不能在servlet中直接使用request.getParameter()方法获取参数，
 	   每一个输入项都是以文件流（不再以字符串）形式传递的
 	 4.
 
 -->
<form name="userForm" enctype="multipart/form-data" action="<%=request.getContextPath()%>/DoEditUserServlet.do" method="post">
  <table width="100%" border="0" cellspacing="0">
    <tr>
      <td height="30"></td>
    </tr>
  </table>
  <table width="835" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="20" colspan="2" ></td>
  </tr>
  <tr>
    <td width="64" ></td>
    <td width="794" height="30" valign="top" class="text_blod_title">修改个人信息</td>
  </tr>
  <tr>
    <td height="15" colspan="2" ><img src="<%=request.getContextPath()%>/images/line1.jpg" width="835" height="6"></td>
    </tr>
  <tr>
    <td colspan="2" background="../images/wb_01 (3).jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="64">&nbsp;</td>
        <td width="771" height="25" align="left" class="text_cray">注：标有 <span class="text_red">*</span> 处，均为必填项</td>
      </tr>
      <tr>
        <td height="20" colspan="2">&nbsp;</td>
        </tr>
    </table>
        <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="15" colspan="4" align="left" class="text_title">登录信息</td>
          </tr>
          <tr>
            <td height="10" colspan="4" ></td>
          </tr>
          <tr>
            <td width="20" align="center" class="text_red1"></td>
            <td width="100" height="40" align="left" class="text_cray1">登录名：</td>
            
            <td class="text_cray">
            
            <!--  理解readonly 和disable的异同：都不能进行修改 ；readonly会把表单域的数据方到服务器，disable不会  -->
            <input type="text" readonly="readonly" disabled="true" value="${user.userName}"/>
            <!-- 对于不等编辑的数据，可以使用readonly进行限制或使用隐藏域进行数据提交 -->
            <input type="hidden" name="userName" id="userName" value="${user.userName}"/>
            </td>
            <c:if test="${empty user.headImage}">
           		 <td width="239" rowspan="6" align="center" ><img src="<%=request.getContextPath()%>/images/photo.jpg" width="120" height="120"></td>
            </c:if>
            <c:if test="${not empty user.headImage}">
           		 <td width="239" rowspan="6" align="center" ><img src="<%=request.getContextPath()%>/${user.headImage}" width="120" height="120"></td>
            </c:if>
            
          </tr>
          <tr>
            <td width="20" align="center" class="text_red1"></td>
            <td width="100" height="40" align="left" class="text_cray1">密码初始化：</td>
            <td class="text_cray"><label>
              <input name="Submit" type="submit" class="text_cray" value="密码初始化">
            </label></td>
          </tr>
          <tr>
            <td height="20" colspan="3"></td>
          </tr>
          <tr>
            <td height="15" colspan="3" align="left" class="text_title">权限设置</td>
          </tr>
          <tr>
            <td height="10" colspan="3"></td>
          </tr>
          <tr>
            <td width="20" align="center" class="text_red">*</td>
            <td width="100" height="40" align="left" class="text_cray1">用户权限：</td>
            <td><select name="userPower" class="text_cray">
            	<!-- 使用jsp标签库进行数据显示控制：jstl -->
            	<!-- 标签库的作用：简化页面代码，增强页面代码可读性 -->
            	<c:if test="${user.userPower eq 1 }">
	                <option selected value="1">管理员</option>
	                <option value="0">普通用户</option>
	            </c:if>
	            <c:if test="${user.userPower eq 0 }">
	                <option value="1">管理员</option>
	                <option selected value="0">普通用户</option>
	            </c:if>
            </select>            
            </td>
          </tr>
        </table>
      <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td height="20" colspan="6"></td>
          </tr>
          <tr>
            <td height="15" colspan="6" align="left" class="text_title">详细信息</td>
          </tr>
          <tr>
            <td height="10" colspan="6" ></td>
          </tr>
          <tr>
            <td width="20" align="center" class="text_red">*</td>
            <td width="100" height="40" align="left" class="text_cray1">真实姓名：</td>
            <td colspan="4" class="text_cray"><input name="trueName" type="text" class="text_cray" id="trueName" value="${user.trueName}"/></td>
          </tr>
          
          <tr>
            <td width="20" align="center" class="text_red">*</td>
            <td width="100" height="40" align="left" class="text_cray1">用户头像：</td>
            <td colspan="4" class="text_cray"><input name="field1" type="file" class="text_cray" id="field1" value="王小明"/></td>
          </tr>
          
          <tr>
            <td width="20" align="center" class="text_red">*</td>
            <td width="100" height="40" align="left" class="text_cray1">性 别：</td>
            <td colspan="4" class="text_cray"><span class="mr25">
            	<c:if test="${user.sex eq 'M'}">
	            	<input type="radio" name="sex" value="M"  checked="checked"/>
	              	<label>男</label>
	              	</span> <span>
	                <input type="radio" name="sex" value="F" />
	              	<label>女</label>
            	
            	</c:if>
            	<c:if test="${user.sex eq 'F'}">
	            	<input type="radio" name="sex" value="M" />
	              	<label>男</label>
	              	</span> <span>
	                <input type="radio" name="sex" value="F"  checked="checked"/>
	              	<label>女</label>
            	
            	</c:if>
              
              
              </span> 
              </td>
          </tr>
          <tr>
            <td width="20" align="center" class="text_red">*</td>
            <td width="100" height="40" align="left" class="text_cray1">省份：</td>
            <td width="106"><label>
              <select name="province" class="text_cray" id="province">
                <option value="省份" selected="selected">省份</option>
              </select>
            </label>            </td>
            <td width="24" align="left"  class="text_cray">&nbsp;</td>
            <td width="43" align="left"  class="text_cray">城市：</td>
            <td width="407" align="left" class="text_cray"><label>
              <select name="city" class="text_cray" id="city">
                <option value="城市" selected="selected">市县</option>
              </select>
            </label>            </td>
          </tr>
          <tr>
            <td width="20" align="center" class="text_red">*</td>
            <td width="100" height="40" align="left" class="text_cray1">证件类型：</td>
            <td colspan="4" ><select class="text_cray" name="cardType" id="cardType">
            	<c:choose>
            		<c:when test="${user.cardType eq '1'}">
            			<option selected value="1"><span>二代身份证</span></option>
            		</c:when>
            		<c:otherwise>
            			<option  value="1"><span>二代身份证</span></option>
            		</c:otherwise>
            	</c:choose>
            	
              	<c:choose>
            		<c:when test="${user.cardType eq 'C'}">
            			<option selected value="C"><span>港澳通行证</span> </option>
            		</c:when>
            		<c:otherwise>
            			<option value="C"><span>港澳通行证</span> </option>
            		</c:otherwise>
            	</c:choose>
            	
            	<c:choose>
            		<c:when test="${user.cardType eq 'G'}">
            			<option selected value="G"><span>台湾通行证</span> </option>
            		</c:when>
            		<c:otherwise>
            			<option value="G"><span>台湾通行证</span> </option>
            		</c:otherwise>
            	</c:choose>
            	
            	<c:choose>
            		<c:when test="${user.cardType eq 'B'}">
            			 <option selectd value="B"><span>护照</span> </option>
            		</c:when>
            		<c:otherwise>
            			<option value="B"><span>护照</span> </option>
            		</c:otherwise>
            	</c:choose>
                
                
                
            </select>           
            </td>
          </tr>
          <tr>
            <td width="20" align="center" class="text_red">*</td>
            <td width="100" height="40" align="left" class="text_cray1">证件号码：</td>
            <td colspan="4" class="text_cray"><input type="text" name="idNumber" id="idNumber" value="${user.idNumber}" /></td>
          </tr>
          <tr>
            <td width="20" align="center" class="text_red">*</td>
            <td width="100" height="40" align="left" class="text_cray1">出生日期：</td>
            <td colspan="4" class="text_cray"><input type="text" name="birthDate" id="birthDate" value="${user.birthDate}"/></td>
          </tr>
          <tr>
            <td width="20" align="center">&nbsp;</td>
            <td width="100" height="40" align="left" class="text_cray1">旅客类型：</td>
            <td colspan="4" class="text_cray"><select class="text_cray" id="passengerType" name="passengerType">
               <c:choose>
            		<c:when test="${user.passengerType eq '1'}">
            			 <option value="1" selected="selected">成人</option>
            		</c:when>
            		<c:otherwise>
            			<option value="1" >成人</option>
            		</c:otherwise>
            	</c:choose>
               
               <c:choose>
            		<c:when test="${user.passengerType eq '2'}">
            			<option value="2" selected="selected">儿童</option>
            		</c:when>
            		<c:otherwise>
            			<option value="2">儿童</option>
            		</c:otherwise>
            	</c:choose>
            	
            	<c:choose>
            		<c:when test="${user.passengerType eq '3'}">
            			  <option value="3" selected="selected">学生</option>
            		</c:when>
            		<c:otherwise>
            			 <option value="3">学生</option>
            		</c:otherwise>
            	</c:choose>
            	
            	<c:choose>
            		<c:when test="${user.passengerType eq '4'}">
            			<option value="4" selected="selected">残疾军人、伤残人民警察</option>
            		</c:when>
            		<c:otherwise>
            			<option value="4">残疾军人、伤残人民警察</option>
            		</c:otherwise>
            	</c:choose>
               
                
                
               
                
            </select>          
            </td>
          </tr>
          <tr>
            <td height="10" colspan="6" >&nbsp;</td>
          </tr>
          <tr>
            <td width="20" align="center">&nbsp;</td>
            <td height="15" align="left" class="text_cray1">备注：</td>
            <td height="15" colspan="4"><textarea name="tips" rows="8" class="text_cray" style="width:100%"><c:out value="${user.tips}"></c:out>
            </textarea></td>
          </tr>
        </table>
      <table width="100%" border="0" cellspacing="0">
        <tr>
          <td>&nbsp;</td>
        </tr>
      </table>
    </table>
  <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="164">&nbsp;</td>
      <td width="99" height="30" align="center"><input  type="submit" class="buttj" id="button"value=""></td>
      <td width="98" align="center">&nbsp;</td>
      <td width="97" align="center"><input  type="reset" class="butcz" id="button2"value=""></td>
      <td width="92" align="center">&nbsp;</td>
    </tr>
  </table>  
  <table width="100%" border="0" cellspacing="0">
  <tr>
    <td height="20">&nbsp;</td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0">
  <tr>
    <td height="2" background="<%=request.getContextPath()%>/images/bottom_point.gif"></td>
  </tr>
  <tr>
    <td height="25" align="center" background="<%=request.getContextPath()%>/images/bottom_ny_bg.gif" class="text_cray">copyright@12306 购票网</td>
  </tr>
</table>
</td>
  </tr>
</table>
</form>

<script type="text/JavaScript" src="<%=request.getContextPath()%>/js/common.js"></script>
</body>
</html>
